<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			window.onload = function()
			{
				let ip = document.querySelector('input');
				let btn = document.querySelector('button');
				
				btn.onclick = function()
				{
					if(ip.value == '' || (ip.value < 10000 || ip.value > 99999) )
					{
						alert('不是水仙花数');
					}
					else
					{
						if( (parseInt(ip.value / 10000) == parseInt(ip.value % 10)) && ( parseInt((ip.value / 1000) % 10) == parseInt((ip.value / 10) % 10)) )
						{
							alert(`${ip.value}是水仙花数`);
						}
						else
						{
							alert(`${ip.value}不是水仙花数`);
						}
					}
				}
			}
		</script>
	</head>
	<body>
		<input type="text" />
		<button>确定</button>
	</body>
</html>